home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc19
/
gemfsc19.lzh
/
GEMFBIND
/
VSTRSTAK.S
< prev
next >
Wrap
Text File
|
1993-03-26
|
2KB
|
47 lines
;*========================================================================
;* VDIFAST Public Domain VDI bindings.
;*========================================================================
;*------------------------------------------------------------------------
;*-----------------------------------------------------------------------
;* vstr_stack.
;*
;* For VDI text functions that need the string stacked into intin in
;* ADE format.
;*
;* This function is not exported to C, it is to be used only by vdi
;* bindings routines.
;*
;* Entry: a0.l -> string
;* Exit: a0.l -> stacked integerized (ADE) string
;* d0.w = stack words used (intin count)
;* d1,a1 = Trashed by this routine.
;*-----------------------------------------------------------------------
;*------------------------------------------------------------------------
globl vstr_stack
vstr_stack:
move.l (sp)+,a1 ;* Save return address.
moveq.l #0,d0 ;* Zero out string length counter.
strcnt: ;* Count up length of string...
tst.b (a0)+ ;* Found end yet?
beq.b strend ;* Yep, go integerize it.
addq.w #1,d0 ;* Nope, add 1 to counter,
bra.b strcnt ;* and keep looking.
strend:
move.w d0,d1 ;* Prime loop counter. Move count to
swap d0 ;* high order d0; use low order as work
strcpy: ;* area for zero-extending bytes.
move.b -(a0),d0 ;* Copy with each string byte in the
move.w d0,-(sp) ;* low byte of each stack word,
dbra d1,strcpy ;* which is how VDI likes to see it.
clr.w d0 ;* clear cruft out of low-order d0
swap d0 ;* swap to put count back in low order.
move.l sp,a0 ;* Save pointer to stacked string.
jmp (a1) ;* Return to caller.
end